﻿@model ChangePasswordModel
@using System.Linq
@using System.Reflection
@using XCode
@using XCode.Configuration
@using NewLife.Cube.Entity;
@{
    var requireOldPass = Model.SsoName.IsNullOrEmpty();
}

@if (ViewBag.StatusMessage != null)
{
    <div class="alert alert-success alert-dismissible text-center" role="alert">
        <button type="button" class="close" data-dismiss="success" aria-label="Close"><span aria-hidden="true">&times;</span></button>
        <strong>@ViewBag.StatusMessage</strong>
    </div>
}
@using (Html.BeginForm("ChangePassword", "User"))
{
    <div class="form-horizontal">
        <div class="row">
            <div class="col-xl-3"></div>
            <div class="col-xl-6">
                @if (requireOldPass)
                {
                    <div class="form-group col-sm-12 col-md-12">
                        <label class="control-label pl-0">原密码</label>
                        <div class="input-group">
                            <input class="form-control" name="OldPassword" type="password" />
                        </div>
                    </div>
                }
                <div class="form-group col-sm-12 col-md-12">
                    <label class="control-label pl-0">新密码</label>
                    <div class="input-group">
                        <input class="form-control" name="NewPassword" type="password" />
                    </div>
                </div>
                <div class="form-group col-sm-12 col-md-12">
                    <label class="control-label pl-0">确认密码</label>
                    <div class="input-group">
                        <input class="form-control" name="NewPassword2" type="password" />
                    </div>
                </div>
            </div>
        </div>

        <div class="row form-actions">
            <div class="col-xl-3"></div>
            <div class="col-xl-6 d-flex justify-content-between" style="padding-right: 25px;">
                <label class="control-label"></label>
                <div>
                    <button type="submit" class="btn btn-success btn-sm"><i class="la la-save"></i><strong>修改密码</strong></button>
                    <button type="button" class="btn btn-danger btn-sm" onclick="history.go(-1);"><i class="la la-remove"></i><strong>取消</strong></button>
                </div>
            </div>
        </div>
    </div>
}
